<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/user/campusCard.js"></script>
		<title>校园卡信息表管理列表</title>
	</head>
	<body>
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div  class="toolbar-panel ">
				<div class="toolbar-box">
					<div class="toolbar-head clearfix">
						<!-- 顶部按钮 -->
						<div class="buttons"> 		
							<a class="btn btn-primary fa fa-search" href="javascript:void(0);" ><span>搜索</span></a>
							<a class="btn btn-primary fa" href="javascript:void(0);" onClick="showPermission();"><span>查看门权限</span></a>
						<%-- 	<a class="btn btn-primary fa fa-add"   href="${ctx}/rdp/user/campusCard/edit.htm" ><span>添加</span></a>
					        <a class="btn btn-primary fa fa-edit"   href="javascript:void(0);"  action="${ctx}/rdp/user/campusCard/edit.htm" ><span>编辑</span></a>	 
					        <a class="btn btn-primary fa fa-remove" href="javascript:void(0);"  action="${ctx}/rdp/user/campusCard/remove.htm"><span>删除</span></a> --%>
						</div>
						<!-- 收缩 -->
						<div class="tools">
							<a href="javascript:void(0);" class="collapse">
								<i class="bigger-180 fa  fa-angle-double-up"></i>
							</a>
						</div>
					</div>
					<!-- #查询条件-->
					<div class="toolbar-body" >
						<form role="form" class="search-form">
							<div  class="form-inline p-xxs">
								<div class="form-group">
									<label   class="search-label">姓名</label>:
									<input type="text"  name="Q^USERNAME^SL"  class="form-control"  />
								</div> 
								<div class="form-group">
									<label   class="search-label">工号</label>:
									<input type="text"  name="Q^USERNUM^SL"  class="form-control"  />
								</div> 
 
								<div class="form-group">									
									<label   class="search-label">卡类型</label>:
									<select  name="Q^CARDTYPE^S" class="form-control" style="width:150px;">
									     <option value="">全部</option>
									     <option value="1">教师</option>
									     <option value="0">学生</option>
									     <option value="2">临时人员</option>
									</select>
								</div> 

							<!-- 	<div class="form-group">
									<label   class="search-label">身份标识</label>:
									<input type="text"  name="Q^PID^S"  class="form-control"  />
								</div> -->
								<div class="form-group">									
									<label   class="search-label">身份名称</label>:
									<select id="datasetProperty"  name="Q^PID^S"  class="form-control" style="width:150px;" >  </select>
								</div> 
								
								
							</div>
						</form>
					</div><!--/ 查询条件-->
				</div>
			</div><!--/ 操作、查询-->
			<div class="jqGrid_wrapper">
				<table id="campusCardGrid" ></table>
				<div id="campusCardPager"></div>
			</div>
		</div>
		<script type="text/javascript">
		
		$(function () {
		    //初始化时间段控件
		    initList();
		 
		 
		});

		
		
		       function showPermission(){
		    	   var grid =$("#campusCardGrid");
		    	   var ids = grid.jqGrid('getGridParam','selarrrow');
			       if(ids.length != 1){
			    	   DialogUtil.confirm("请选择一个用户");
			    	   return;
			       }
			       var rowData= grid.jqGrid("getRowData",ids[0]);
			       var usernum = rowData.usernum
		    	   
		    	   
		    	   DialogUtil.dialog(
		  				 {
		  		 				title : "用户权限列表",
		  		 				content : '${ctx}/rdp/CurrentPermission/currentPermission/userPermissionPage.htm?usernum='+usernum,
		  		 				area : [ '1200px', '600px' ],
		  		 				maxmin : false
		  		 		}
		  		 );
		    	   
		       }
		       
		       
		       //初始化pid=pidname 之间的关系
		       function initList(queryParam1,selectClass, selectedDataStr) {
		    		//alert("时间段初始化");
		    	    var paramData = {
		    	        'testParam1': queryParam1
		    	    }
		    	    $.ajax({
		    	        url: _ctx+"/rdp/campusPid/campusPid/getData",
		    	        type: 'get',
		    	        data: paramData,
		    	        async: false,
		    	        success: function (returnData) {
		    	        	console.log(returnData);
		    	            var objs = $.parseJSON( JSON.stringify(returnData));
		    	      
		    	           
		    	          var html = "";
		    	           $('#datasetProperty').append("<option value=''  checked='checked'>--请选择--</option>");
		    	            for (var i in objs) {
		    	            	html += '<option value=' + objs[i].pid  + '>' + objs[i].pidname + '</option>'
		    	            }
		    	            $("#datasetProperty").append(html); //渲染
		    	        },
		    	        error: function (e) {
		    	            alert(e.msg);
		    	        }
		    	    });
		    	}
		       
		       
		</script>
		
		
	
	</body>
	
</html>